package com.jiantong.user.impl.dao;

import com.jiantong.user.model.BreedFactoryStable;
import io.terminus.common.mysql.dao.MyBatisDao;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by mz on 24/7/17.
 *
 */
@Repository
public class BreedFactoryStableDao extends MyBatisDao<BreedFactoryStable>{

    /**
     * 查询养殖场的栏舍的list
     * @param criteria 参数
     * @return List<BreedFactoryStable>
     */
    public List<BreedFactoryStable> findStableList(Map<String , Object> criteria){
        return getSqlSession().selectList(sqlId("findStableList"),criteria);
    }


    public Boolean updateFromSC(BreedFactoryStable breedFactoryStable){
        return getSqlSession().update(sqlId("updateSC"),breedFactoryStable) > 0;
    }

    /**
     * 栏舍是否存在
     * @param criteria 参数
     * @return Long
     */
    public Long isExist(Map<String , Object> criteria){
        return getSqlSession().selectOne(sqlId("isExist"),criteria);
    }
}
